﻿<%@ Page Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true" CodeBehind="BestPlanets.aspx.cs" Inherits="smallDeimos.BestPlanets" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
            DataSourceID="SqlDataSource1">
            <Columns>
                <asp:BoundField DataField="SystemName" HeaderText="SystemName" SortExpression="SystemName" />
                <asp:BoundField DataField="PlanetID" HeaderText="PlanetID" SortExpression="PlanetID" />
                <asp:BoundField DataField="PlayerName" HeaderText="PlayerName" SortExpression="PlayerName" />
                <asp:BoundField DataField="Farms" HeaderText="Farms" SortExpression="Farms" />
                <asp:BoundField DataField="Factories" HeaderText="Factories" SortExpression="Factories" />
                <asp:BoundField DataField="Cybernets" HeaderText="Cybernets" SortExpression="Cybernets" />
                <asp:BoundField DataField="Labs" HeaderText="Labs" SortExpression="Labs" />
                <asp:BoundField DataField="PopulationLevel" HeaderText="PopulationLevel" SortExpression="PopulationLevel" />
            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:smallDeimosConnectionString %>"
            SelectCommand="SELECT TOP (50) Systems.SystemName, Planets.PlanetID, Players.PlayerName, Planets.Farms, Planets.Factories, Planets.Cybernets, Planets.Labs, Planets.PopulationLevel FROM Planets INNER JOIN Players ON Planets.OwnerID = Players.PlayerId INNER JOIN Systems ON Planets.SystemID = Systems.SystemID WHERE (Players.PlayerId &gt; 1) ORDER BY Planets.Farms + Planets.Factories + Planets.Cybernets + Planets.Labs Desc">
        </asp:SqlDataSource>
</asp:Content>
